package cn.anc.aonicardv.module.ui.my;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import cn.anc.aonicardv.Constant;
import cn.anc.aonicardv.R;
import cn.anc.aonicardv.module.ui.base.BaseActivity;
import cn.anc.aonicardv.util.DeviceInfo;
import cn.anc.aonicardv.util.LogUtil;
import cn.anc.aonicardv.util.SpUtils;

/**
 * function :
 * </p>
 *
 * @author: aoni123@anc.cn
 * @date: 2021/5/12
 */
public class LogActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        setContentView(R.layout.activity_loginfo);
        super.onCreate(savedInstanceState);
    }

    @Override
    public void initVariable() {
    }

    @Override
    public void setListener() {
    }

    private TextView mDevicesInfoTv, mTitleTv,mCrashTv;

    @Override
    public void initData() {
        findViewById(R.id.tv_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mTitleTv = (TextView) findViewById(R.id.tv_title);
        mDevicesInfoTv = (TextView) findViewById(R.id.tv_devices_info);
        mCrashTv = (TextView) findViewById(R.id.tv_crash_info);
        mTitleTv.setText("日志查看");
        mDevicesInfoTv.setText(DeviceInfo.getDeviceInfo());

      boolean isReady =  SpUtils.getBoolean(Constant.SpKeyParam.APP_ECARX_API_LOG, false);
        StringBuffer logInfo = new StringBuffer();
        logInfo.append(DeviceInfo.getDeviceInfo());
        logInfo.append("\n-eCarx API Ready:" +  isReady);
        mDevicesInfoTv.setText(logInfo.toString());
        LogUtil.e("llcTest0908","------------logInfo:"+logInfo.toString());
        String mLogText =  SpUtils.getString(Constant.SpKeyParam.APP_LOG, "");
        LogUtil.e("llcTest0908","------------mLogText:"+mLogText);
        mCrashTv.setText(mLogText+"");

    }




}
